home *** CD-ROM | disk | FTP | other *** search
- @echo off
- REM ********************************************************************
- REM *** Pwd - Show the name of current directory ***
- REM *** this could be done simply by puts(FullPath(".")) but I ***
- REM *** wanted to test how to use BIOS interrupts with CEnvi ***
- REM Jouni Miettunen * jon@stekt.oulu.fi * Oulu * Finland * Europe * 1993
- REM ********************************************************************
- @CEnvi %0.bat %1
- GOTO CENVI_EXIT
-
- main(argc,argv)
- {
- if ( argc != 1 )
- Instructions();
- else
- get_cwd()
- }
-
- get_cwd()
- {
- // reserve 200 bytes long buffer
- BLObSize(buffer,200);
- regs.ah = 0x47;
- regs.dl = 0; // 0 for default
- regs.si = offset(buffer);
- regs.ds = segment(buffer);
- interrupt(0x21,regs); //get path
- regs.ah = 0x19;
- interrupt(0x21,regs); //get drive
- printf("%c:\\%s\n",regs.al+'a',strlwr(buffer));
- }
-
- Instructions()
- {
- puts("");
- puts("pwd - Print Working Directory");
- puts("");
- puts("Usage: pwd");
- }
-
- :CENVI_EXIT